package com.intramirror.msdemo.client;

import com.intramirror.wd.common.bean.R;
import org.springframework.web.client.RestTemplate;

/**
 * Created by snfdf on 2019/1/11 15:17
 */
public class Demo {

    public static void main(String[] args) {
        ServiceAddress addr = SearchAddressSelector.selectOne("search");
        if (addr != null) { //获取到了服务
            R result = new RestTemplate().getForObject(addr.getServiceAddress() + "name/hello", R.class);
            System.out.println(result);
        } else {
            System.out.println("服务不可用");
        }
    }
}
